<template>
	<view>
		<view style="height: 200rpx;">
			
		</view>
		<view class="viewTinputT flex-row-space-between">
			<view class="flex-row-flex-start" style="width: 116rpx;">
				<view class="bianhao">
					+86
				</view>
				<image src="/static/login_down.png" style="width: 14rpx;height: 8rpx;margin-left: 14rpx;"></image>
			</view>
			<input class="inputT" v-model="mobile" type="number" style="width: 502rpx;" placeholder="请输入手机号" />
		</view>
		<view class="viewTinputT">
			<view class="viewT" style="margin-bottom: 16rpx;">
				验证码
			</view>
			<u-input border="none" placeholder="请输入验证码" v-model="captcha" style="width: 618rpx;margin-top: 16rpx;">
				<template slot="suffix">
					<u-code ref="uCode" @change="codeChange" seconds="60" changeText="X秒重新获取"></u-code>
					<view @click="getCode" style="font-family: PingFang SC, PingFang SC;font-weight: 500;font-size: 32rpx;color: #E93548;">
						{{tips}}
					</view>
				</template></u-input>
		</view>
		<view class="viewTinputT">
			<view class="viewT">
				新密码
			</view>
			<input placeholder="请输入新密码" :password="true" v-model="captcha" style="width: 618rpx;margin-top: 16rpx;"/>
		</view>
		<view class="viewTinputT">
			<view class="viewT">
				再次输入密码
			</view>
			<input placeholder="请再次输入密码" :password="true" v-model="captcha" style="width: 618rpx;margin-top: 16rpx;"/>
		</view>
		
		<view @click="loginMobile()" class="loginButton">
			去登录
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mobile: '',
				captcha: '',
				tips: '获取验证码',
			}
		},
		onShow() {

		},
		onLoad() {

		},
		methods: {
			// 点击获取验证码
			getCode() {
				if (!(/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.mobile))) {
					uni.showToast({
						title: '请输入正确的手机号',
						icon: 'none'
					});
					return false;
				}
				
				this.$refs.uCode.start();
				
				// this.$refs.uCode.reset();
			},
			codeChange(text) {
				// console.log(text)
				this.tips = text
			},
			loginMobile() {
				uni.navigateBack()
			},
		}
	}
</script>

<style lang="scss">
	page{
		background: #FFFFFF;
	}
	
	.viewTinputT{
		margin-left: 66rpx;
		width: 618rpx;
		padding-top: 24rpx;
		padding-bottom: 24rpx;
		border-bottom: 1rpx solid #CCCCCC;
	}
	.bianhao{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #333333;
	}
	.viewT{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 30rpx;
		color: #333333;
	}
	.inputT{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #333333;
	}
	
	.loginButton {
		margin-top: 60rpx;
		margin-left: 64rpx;
		width: 620rpx;
		height: 90rpx;
		background: linear-gradient( to bottom, #E93548 0%, #F35B43 100%);
		box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(235,43,59,0.4);
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #FFFFFF;
		line-height: 90rpx;
		text-align: center;
	}
	
	
</style>
